package com.sardine.base.hbase.generator;

import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.MD5Hash;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 上海京东到家元信信息技术有限公司<br>
 * Created with IntelliJ IDEA.
 * Date:2017/11/22
 * Time:16:50
 *
 * @author daifeng<br>
 *         daifeng@imdada.cn
 * @since JDK 1.7 <br>
 * Copyright (c) 2017 imdada System Incorporated All Rights Reserved.
 */
public class MD5HashGeneratorImpl implements Generator {
    private static final Logger logger = LoggerFactory.getLogger(MD5HashGeneratorImpl.class);

    /**
     * 得到一个行健
     *
     * @param o
     * @return
     */
    @Override
    public String rowKey(String o) {
        return MD5Hash.getMD5AsHex(Bytes.toBytes(o));
    }
}
